import axios from 'axios'
const dayjs = require('dayjs')
// const customParseFormat = require('dayjs/plugin/customParseFormat')
// dayjs.extend(customParseFormat)
// axios instence
const http = axios.create({
	headers: { 'Content-Type': 'application/json' },
})
export default {
	modifyboss(boss) {
		delete boss.countdown
		delete boss.nextReborn
		return http.put('/api/boss/boss', {
			...boss,
			lastDeath: new dayjs(boss.lastDeath).format('YYYY/MM/DD HH:mm:ss'),
		})
	},
	setLastDeathAll(ids, date) {
		ids.forEach((id) => {
			http.put('/api/boss/boss', {
				id,
				lastDeath: new dayjs(date).format('YYYY/MM/DD HH:mm:ss'),
			})
		})
	},
}
